package servlet.discussion;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import bean.control.DiscussionMgr;

@SuppressWarnings("serial")
public class AnsDiscussServlet extends HttpServlet {
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		HttpSession session = req.getSession();
		String memId = (String)session.getAttribute("memId");
		
		if (memId != null) {
			req.setCharacterEncoding("utf-8");
			String content = req.getParameter("content");
			String disId = req.getParameter("disId");
			
			DiscussionMgr.updateDiscussContentById(Long.parseLong(memId), content, Long.parseLong(disId));
		}
	}
}
